﻿@model IEnumerable<MusicOnLine.Models.Album>

@{
    ViewBag.Title = "专辑管理";
    Layout = "~/Views/Shared/_Layoutback.cshtml";
}

<script src="@Url.Content("~/Scripts/jQuery.tmpl.min.js")"></script>
<script src="@Url.Content("~/Scripts/Common/pageHandler.js")"></script>
<link href="@Url.Content("~/Content/PageHandler.css")" rel="stylesheet" />
<script id="albumTemplate" type="text/x-jquery-tmpl">
    <div style="clear:both; height:20px;">
        <div class="divellipsis" style="float:left; width:300px;text-align:left;"><a href="/ManageAlbum/Details/${ID}">${AlbumName}</a></div>
        <div class="divellipsis" style="float:left; width:200px;text-align:left;">${ArtistName}</div>
        <div class="divellipsis" style="float:left; width:100px;text-align:left; height:20px;">${PublishYear}</div>        
        <div class="divellipsis" style="float:left; width:100px;text-align:left;height:20px;">${SongsCount}</div> 
        <div style="float:left; width:100px; text-align:center;"><a href="/ManageAlbum/Delete/${ID}">删除</a></div>   
    </div>
</script>
<div id="btnUploadAlbum" class="divButton" style="float:right;width:60px; margin-left:5px;" onclick="window.location=$(this).attr('data-action')" data-action="@Url.Action("UploadAlbum","ManageAlbum")">
                上传专辑 
        </div>
<div style="clear:both;"></div>       
<fieldset>
    <legend>专辑列表</legend>
    
             
  
    <div style="clear:both; height:5px;"></div> 
      <div style="clear:both;">
         <div class="divellipsis" style="float:left; width:300px;text-align:left;">专辑名</div>
        <div class="divellipsis" style="float:left; width:200px;text-align:left;">歌手</div>
        <div class="divellipsis" style="float:left; width:100px;text-align:left;">发布年份</div>       
        <div class="divellipsis" style="float:left; width:100px;text-align:left;">曲目数量</div>        
    </div>
   <div id="divAlbumList"></div> 
    <div id="divPage">       
    </div> 
</fieldset>

<script type="text/javascript">
    $(document).ready(function () {
        $("#divMangeAlbum").addClass("currentMenu");

        $("#txtQText").each(function () {
            var target = $(this);
            target.autocomplete({ source: "/ManageAlbum/QuickSearchAlbum" });
        });       
        var page = new pageHandler({ pageID: "divPage", url: "/ManageAlbum/AlbumList", tmplID: "albumTemplate", contentID: "divAlbumList", queryID: "txtQText", isCss: true })
        page.pageInit();
        $("#btnSearch").click(function () {
            page.pageInit();
        })
    })
</script>